// 实验技术要求管理
const Mock = require('mockjs');
// 获取 mock.Random 对象
const Random = Mock.Random;
// mock一组数据
const produceNewsData = function() {
    let articles = [];
    for (let i = 0; i < 5; i++) {
        let newArticleObject = {
            part_number: Random.csentence(2, 3), //  Random.csentence( min, max )
            part_graph_number: Random.csentence(2, 3), // Random.dataImage( size, text ) 生成一段随机的 Base64 图片编码
            material_furnance_number: Random.cname(), // Random.cname() 随机生成一个常见的中文姓名
            part_name: Random.date(),
            project_no: Random.csentence(2, 3),
            material_no: Random.csentence(2, 3),
            sample_status_phase: Random.csentence(2, 3),
            batch_number: Random.csentence(2, 3),
            status: Random.csentence(2, 3),
            remark: Random.csentence(2, 3)
        }
        articles.push(newArticleObject)
    }
 
    return {
        articles: articles
    }
}
 
// Mock.mock( url, post/get , 返回的数据)；
// 列表
Mock.mock('/system/partList', 'get', {
            "success": true,
            "message": "success",
            "code": 200,
            "timestamp": 1535082178117,
            "result": {
            "content": [{
                "id": "16739222421508096",
                "createBy": "",
                "createTime": "2018-06-06 18:48:02",
                "updateBy": "",
                "updateTime": "2018-06-06 18:57:55",
                "delFlag": 0,
                "part_number": "P001",
                "part_graph_number": "T001",
                "material_furnance_number": "111",
                "part_name": "零件名称",
                "project_no": "111",
                "material_no": "111",
                "sample_status_phase": "111",
                "batch_number": "111",
                "status": "0",
                "remark": "备注"
                }
            ],
            "pageable": {
                "offset": 0,
                "pageSize": 10,
                "pageNumber": 0,
            },
            "totalElements": 4, 
            "totalPages": 1,
            "size": 10, 
                }
            });

// 零件明细
Mock.mock('/system/partInfo', 'post', {
    "success": true,
    "message": "success",
    "code": 200,
    "timestamp": 1535082178117,
    "result": {
        "id": "4363087427670016",
        "createBy": "",
        "createTime": "2018-05-03 15:09:42",
        "updateBy": "",
        "updateTime": "2018-06-06 18:58:25",
        "delFlag": 0,
        "part_number": "P001",
        "part_graph_number": "T001",
        "material_furnance_number": "111",
        "part_name": "零件名称",
        "project_no": "111",
        "material_no": "111",
        "sample_status_phase": "111",
        "batch_number": "111",
        "status": "0",
        "remark": "备注"
    }
  });